Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for bugged items in checkout, then remove them from the ASIN list #529

Open
wants to merge 6 commits into
base: development
Choose a base branch
from

Conversation

tionw
Copy link

@tionw tionw commented Feb 27, 2021

  • check for bugged items in checkout. bugged items will require adding an address at checkout page rather than "place your order". this just checks if there is more than 1 button click needed at checkout page, and if so, it is probably bugged.

  • reduce timeout to wait for content page for bugged items to speed up check process

  • we probably don't want the bot caught stuck on one of these bugged items, and not be able to check other items in the process, so I was thinking to remove the bugged item outright. A different implementation may be better though..

@tionw
Copy link
Author

tionw commented Feb 27, 2021

not sure why its failing the check in that commit, i just removed an extra line i added earlier.

if yall think its better to just let the bot run and try to checkout the bugged items on repeat i can just close this PR

@jersmo
Copy link

jersmo commented Mar 1, 2021

Any idea if it’s possible to have a bugged seller rather than a bugged product? If that Asin were offered by another seller could it potentially pass through checkout just fine?

@polow
Copy link

polow commented Mar 1, 2021

Nice work it does bypass ship to address bug, but bugged items making this bot start over from the beginning instead of resuming to the end of the list.

Copy link
Collaborator

@DakkJaniels DakkJaniels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than add to the do_button_click method, couldn't we accomplish the same thing by just moving the increment to the checkout_retry counter at the start of each call to handle_cart? Probably should do the same for the PYO counter too. Right now it only counts up if there is a failure, but I think it makes more sense to just count how many times we hit the method while it tries to checkout. Then we don't need to add special code to the button click method just for checkout, and you can move the prune code to the existing comparison check at line ~274.

Also, pruning out the items automatically should be optional (someone might want it to keep hitting the items no matter what). Can you add a flag for this in cli? --prune-bugged-items ?

@gtrak
Copy link

gtrak commented Mar 1, 2021

The existing code is a little hard to track. Might I suggest storing a data structure of ASIN to last known bugged time, then only checking it past a 30 minute timeout window?

@DakkJaniels
Copy link
Collaborator

If you want to write it lol, sure

@gtrak
Copy link

gtrak commented Mar 1, 2021

Not sure yet if I want to write it, but if you see a PR, you will know I did :D

@tionw
Copy link
Author

tionw commented Mar 1, 2021

Rather than add to the do_button_click method, couldn't we accomplish the same thing by just moving the increment to the checkout_retry counter at the start of each call to handle_cart? Probably should do the same for the PYO counter too. Right now it only counts up if there is a failure, but I think it makes more sense to just count how many times we hit the method while it tries to checkout. Then we don't need to add special code to the button click method just for checkout, and you can move the prune code to the existing comparison check at line ~274.

Also, pruning out the items automatically should be optional (someone might want it to keep hitting the items no matter what). Can you add a flag for this in cli? --prune-bugged-items ?

Thanks for the feedback. That's probably a good idea, I'll work on it - might take me a couple days as I'm busy this week.

gtrak thats what I was thinking we could do too, since we might want to check again after a timeout. will try that out too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants